package com.dup.jxlh.api.enums;

public enum ContractTypeEnum {
    COSTCONSULTATION(1, "造价咨询"),
    BIDDINGAGENCY(2, "招标代理"),
    PROJECTSUPERVISION(3, "工程监理"),
    OTHER(9, "其他");

    private Integer code;
    private String name;

    ContractTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(Integer code) {
        for (ContractTypeEnum stateEnum: values()){
            if(stateEnum.getCode() == code){
                return stateEnum.getName();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
